package com.three.controller;

import com.three.aop.LogAnotation;
import com.three.entity.Backlightcolor;
import com.three.service.BacklightcolorService;
import com.three.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/backlightcolor")
public class BacklightcolorController {
    @Autowired
    private BacklightcolorService backlightcolorService;
    @GetMapping("/list")
    public R getBacklightcolor(){
        return backlightcolorService.list();
    }

    //页面展示所有和分页
    @PostMapping("/backlightcolorlist")
    public R getBacklightcolorAll(Integer pageNum, Integer pageSize, @RequestBody Backlightcolor backlightcolor){
        return backlightcolorService.BacklightcolorAll(pageNum,pageSize,backlightcolor);
    }

    //添加
    @PostMapping("/addbacklightcolor")
    @LogAnotation(value = "进行背光颜色的添加")
    public R add(@RequestBody Backlightcolor backlightcolor){
        return backlightcolorService.add(backlightcolor);
    }

    //编辑
    @PostMapping("/editbacklightcolor")
    @LogAnotation(value = "进行背光颜色的编辑")
    public R edit(@RequestBody Backlightcolor backlightcolor){
        return backlightcolorService.edit(backlightcolor);
    }

    //删除
   @DeleteMapping("/deletebacklightcolor")
   @LogAnotation(value = "进行背光颜色的删除")
    public R delete(Integer backlightcolorid){
        return backlightcolorService.delete(backlightcolorid);
    }
}
